<script setup lang="ts">
import type { RecordListItem } from '@/types/api/record'
import { useRecord } from '@/stores'
import { onShow } from '@dcloudio/uni-app'
import { reactive, ref } from 'vue'
import { object } from 'zod'

const record = useRecord()

const form = reactive<RecordListItem>({})
onShow(() => {
  record.init()
  const obj = record.recordDetails
  console.log('form', obj)
  Object.assign(form, obj)
})
</script>

<template>
  <view class="px-30px py-20px">
    <view class="overflow-hidden rd-16px bg-white pl-20px">
      <uni-forms :model-value="form">
        <uni-forms-item class="" label="姓名" name="name">
          <input
            v-model="form.name"
            class="h-100px text-26px"
            type="text"
            disabled
          >
        </uni-forms-item>
        <uni-forms-item class="" label="手机号" name="phone">
          <input
            v-model="form.phone"
            class="h-100px text-26px"
            type="text"
            maxlength="11"
            disabled
          >
        </uni-forms-item>
        <uni-forms-item class="" label="身份证" name="identNumber">
          <input
            v-model="form.identNumber"
            class="h-100px text-26px"
            type="text"
            disabled
          >
        </uni-forms-item>
        <uni-forms-item class="" label="审核状态" name="sesameScore">
          <view v-if="form.status === 1" class="text ml-10px text-30px">
            通过
          </view>
          <view
            v-if="form.status === 2"
            class="ml-10px text-30px"
            style="color: #f53b0e"
          >
            拒绝
          </view>
          <view
            v-if="form.status === 0"
            class="ml-10px text-30px"
            style="color: #3d81f8"
          >
            待审
          </view>
        </uni-forms-item>
        <uni-forms-item class="" label="审核原因" name="sesameScore">
          <input
            v-model="form.remark"
            class="text-26px"
            type="text"
            disabled
          >
        </uni-forms-item>
      </uni-forms>
    </view>
  </view>
</template>

<style lang="less" scoped>
:deep(.uni-forms) {
  .uni-forms-item {
    --uno: 'items-center b-b-gray-300 b-b-solid !mb-0';
    height: 100rpx;
    border-bottom-width: 1rpx;
  }
}
</style>
